/* eslint-disable */
import request from "@/request";

/** addBook POST /api/api/book/add */
export async function addBookUsingPost(
  body: API.Book,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>("/api/api/book/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** batchAddBooks POST /api/api/book/batch/add */
export async function batchAddBooksUsingPost(
  body: API.Book[],
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/book/batch/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteBook POST /api/api/book/delete/${param0} */
export async function deleteBookUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteBookUsingPOSTParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean_>(`/api/api/book/delete/${param0}`, {
    method: "POST",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** getBookById GET /api/api/book/get/${param0} */
export async function getBookByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getBookByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBook_>(`/api/api/book/get/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** listBooks GET /api/api/book/list */
export async function listBooksUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListBook_>("/api/api/book/list", {
    method: "GET",
    ...(options || {}),
  });
}

/** listRecommendBooks GET /api/api/book/recommend */
export async function listRecommendBooksUsingGet(options?: {
  [key: string]: any;
}) {
  return request<API.BaseResponseListBook_>("/api/api/book/recommend", {
    method: "GET",
    ...(options || {}),
  });
}

/** updateBook POST /api/api/book/update */
export async function updateBookUsingPost(
  body: API.Book,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/book/update", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
